#include <stdio.h>
int main()
{
	int day, month, year, sum;
	printf("\n请输入年、月、日，格式为：年,月,日（2015-12-10）\n");
	scanf("%d-%d-%d", &year, &month, &day);
	int Month1Total = 31, Month3Total = 31, Month5Total = 31,
	    Month7Total = 31, Month8Total = 31,
	    Month10Total = 31; //1、3、5、7、8、10月份的总天数
	int Month4Total = 30, Month6Total = 30,
	    Month9Total = 30, Month11Total = 30; //4、6、9、11月份的总天数
	int Month2Total;//2月份的天数

	if (year % 400 == 0 || (year % 4 == 0 && year % 100 != 0)) // 判断是不是闰年
	{
		Month2Total = 29;
	}
	else
	{
		Month2Total = 28;
	}

	if (month == 1)
	{
		sum = day;
	}
	if (month == 2)
	{
		sum = Month1Total + day;
	}
	if (month == 3)
	{
		sum = Month1Total + Month2Total + day;
	}
	if (month == 4)
	{
		sum = Month1Total + Month2Total + Month3Total + day;
	}
	if (month == 5)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total
		      + day;
	}
	if (month == 6)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total +
		      Month5Total
		      + day;
	}
	if (month == 7)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total +
		      Month5Total + Month6Total
		      + day;
	}
	if (month == 8)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total +
		      Month5Total + Month6Total + Month7Total
		      + day;
	}
	if (month == 9)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total +
		      Month5Total + Month6Total + Month7Total +
		      Month8Total	+ day;
	}
	if (month == 10)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total +
		      Month5Total + Month6Total + Month7Total +
		      Month8Total	+ Month9Total + day;
	}
	if (month == 11)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total +
		      Month5Total + Month6Total + Month7Total +
		      Month8Total	+ Month9Total + Month10Total + day;
	}
	if (month == 12)
	{
		sum = Month1Total + Month2Total + Month3Total + Month4Total +
		      Month5Total + Month6Total + Month7Total +
		      Month8Total	+ Month9Total + Month10Total + Month11Total + day;
	}
	printf("这是这一年的第 %d 天。", sum);
	printf("\n");
}
